package com.weige.api.config;

import com.weige.api.fallback.UserClientFallbackFactory;
import feign.Logger;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: wei
 * @date: 2022-11-12 12:05
 * @description: 日志级别配置类
 */
@Configuration
@EnableFeignClients(basePackages = "com.weige.api.client") //  开启Feign的功能支持
public class DefaultFeignConfiguration {
    @Bean
    public Logger.Level feignLogLevel() {
        return Logger.Level.BASIC; // 日志级别为BASIC
    }

    @Bean
    public UserClientFallbackFactory userClientFallbackFactory() {
        return new UserClientFallbackFactory();
    }
}
